package cn.org.exam.controller.user;

import cn.org.exam.common.result.Result;      // ★ 统一返回结构
import cn.org.exam.mapper.UserMapper;         // ★ UserMapper
import cn.org.exam.model.entity.User;         // ★ User 实体

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api/users")
public class UserController {

    private final UserMapper userMapper;

    public UserController(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @GetMapping
    public Result<List<User>> list() {
        return Result.ok(userMapper.selectList(null));
    }
}

